package com.syher.dynamic.datasource.service.impl;

import com.syher.dynamic.datasource.mapper.first.FirstMapper;
import com.syher.dynamic.datasource.mapper.second.SecondMapper;
import com.syher.dynamic.datasource.service.IDemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by shenyuhang on 2018/3/8.
 */
@Service
public class DemoService implements IDemoService {

    @Autowired
    FirstMapper firstMapper;

    @Autowired
    SecondMapper secondMapper;


    @Override
    public String getWord() {
        StringBuilder stringBuilder = new StringBuilder(128);

        return stringBuilder.append("user[")
                .append(secondMapper.getById(1).getName())
                .append("] has tag ")
                .append(firstMapper.getById(9999).getTagName())
                .append(".")
                .toString();
    }
}
